<{include file="public_html/header.html"}>
<{include file="public_html/left_menu.html"}>

<script type="text/javascript">
	var dire = 'user';
	var thumb = 'big_thumb,middle_thumb,small_thumb';
	var fileNumLimit = 1;
</script>

<blockquote class="layui-elem-quote"><{$action}></blockquote>

<form class="layui-form layui-form-pane" method="post" action="/user/save" id="add_user">
	<input type="hidden" value="<{$user_info['id']|default:"0"}>" name="id" />

	<div class="layui-form-item">
		<label class="layui-form-label">用户昵称</label>
		<div class="layui-input-block">
            <input type="text" class="layui-input" name="nick" lay-verify="required" value="<{$user_info.nick|default:""}>" >
		</div>
	</div>

	<div class="layui-form-item">
		<label class="layui-form-label">手机号码</label>
		<div class="layui-input-block">
            <input type="tel" name="mobile" lay-verify="" autocomplete="off" class="layui-input" value="<{$user_info['mobile']|default:''}>">
		</div>
	</div>

	<div class="layui-form-item">
		<label class="layui-form-label">CDN</label>
		<div class="layui-input-block">
            <select name="cdn">
	         	<option value="0" selected>请选择</option>
			    <{foreach from=$cdn_list item=item}>
				<option value="<{$item['id']}>" <{if isset($user_info['cdn'])}><{if $item['id'] eq $user_info['cdn']}> selected<{/if}><{/if}> ><{$item['cdn']}></option>
			    <{/foreach}>
			</select>
		</div>
	</div>

	<{if ! isset($user_info['nick'])}>
	<div class="layui-form-item">
    	<label class="layui-form-label">登陆密码</label>
        <div class="layui-input-block">
      		<input type="password" name="password" lay-verify="pass" placeholder="请输入密码" autocomplete="off" class="layui-input">
        </div>
  	</div>

  	<div class="layui-form-item">
    	<label class="layui-form-label">确认密码</label>
        <div class="layui-input-block">
      		<input type="password" name="confirm_password" lay-verify="pass" placeholder="请输入确认密码" autocomplete="off" class="layui-input">
        </div>
  	</div>
  	<{/if}>

  	<{if isset($user_info['verified_anchor']) and $user_info['verified_anchor'] == 1}>
  	<div class="layui-form-item">
		<label class="layui-form-label">直播间人数基数</label>
		<div class="layui-input-block">
            <input type="text" class="layui-input" name="h_count_base" lay-verify="required" value="<{$user_info['h_count_base']|default:''}>" >
		</div>
	</div>
	<{/if}>

    <div class="layui-form-item">
        <label class="layui-form-label">邮箱地址</label>
        <div class="layui-input-block">
            <input type="email" class="layui-input" name="email" lay-verify="required" value="<{$user_info['email']|default:''}>" >
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">性别</label>
        <div class="layui-input-block">
          <input type="radio" name="sex" value="1" title="男" <{if $user_info['sex']|default:"" eq 1}>checked<{/if}>>
          <input type="radio" name="sex" value="0" title="女" <{if $user_info['sex']|default:"" eq 0}>checked<{/if}>>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">是否认证</label>
        <div class="layui-input-block">
            <{assign var="anchor" value=$user_info.anchor|default:"0"}>
            <input type="checkbox" <{if $anchor == 1}> checked <{/if}> name="anchor" lay-skin="switch" lay-filter="switchTest" value="1" >
        </div>
    </div>

	<div class="layui-form-item">
		<input type="hidden" id="token" value="<{'VIMG'|get_qiniu_token}>" />
		<label class="layui-form-label">用户头像</label>
		<div class="layui-input-block">
            <div id="uploader2" class="upload_box" style="float:left; width:420px;">
                <div class="queueList">
                    <div id="dndArea2" class="placeholder dndArea">
                        <div id="filePicker2" class="filePicker"></div>
                        <p>或将照片拖到这里，最多可上传<script>document.write(fileNumLimit);</script>张图片</p>
                    </div>
                </div>
                <div class="statusBar" style="display:none;">
                    <div class="progress">
                        <span class="text">0%</span>
                        <span class="percentage"></span>
                    </div><div class="info"></div>
                    <div class="btns">
                        <div id="filePickerBut2" class="filePickerBut"></div><div class="uploadBtn">开始上传</div>
                    </div>
                </div>
                <div class="upload_img_input" input_name='head_image_url'></div>
            </div>
            <{if isset($user_info['head_image_url']) AND $user_info['head_image_url'] != ''}>
	  			<div class="layui-inline" style="float:left;"><img src="<{$user_info['head_image_url']}>" style="max-height:175px;"/></div>
	  		<{/if}>
		</div>
	</div>

	<div class="layui-form-item">
		<label class="layui-form-label">直播封面</label>
		<div class="layui-input-block">
            <div id="uploader4" class="upload_box" style="float:left; width:420px;">
                <div class="queueList">
                    <div id="dndArea4" class="placeholder dndArea">
                        <div id="filePicker4" class="filePicker"></div>
                        <p>或将照片拖到这里，最多可上传<script>document.write(fileNumLimit);</script>张图片</p>
                    </div>
                </div>
                <div class="statusBar" style="display:none;">
                    <div class="progress">
                        <span class="text">0%</span>
                        <span class="percentage"></span>
                    </div><div class="info"></div>
                    <div class="btns">
                        <div id="filePickerBut4" class="filePickerBut"></div><div class="uploadBtn">开始上传</div>
                    </div>
                </div>
                <div class="upload_img_input" input_name='image_url'></div>
            </div>
            <{if isset($user_info['image_url']) AND $user_info['image_url'] != ''}>
	  			<div class="layui-inline" style="float:left;"><img src="<{$user_info['image_url']}>" style="max-height:175px;"/></div>
	  		<{/if}>
		</div>
	</div>

	<div class="layui-input-block">
  		<button class="layui-btn" lay-submit lay-filter="*">立即提交</button>
		<button type="reset" class="layui-btn layui-btn-primary">重置</button>
	</div>
</form>

<{include file="public_html/footer.html"}>